package org.trc.network;


/**
 * 
 * 
 * @author Lin Xu
 *
 */

public class Arc {
	public String id; // 为了标识弧段，引入弧段ID id = startNodeId + endNodeId
	public String startNodeId;
	public String endNodeId;
	public String edgeId;
    public double weighted;

	public Arc() {
	}

	public Arc(String edgeId, String startNodeId, String endNodeId) {
		this(edgeId, startNodeId, endNodeId, 0);
	}

	public Arc(String edgeId, String startNodeId, String endNodeId,double weighted) {
		this.edgeId = edgeId;
		this.startNodeId = startNodeId;
		this.endNodeId = endNodeId;
		this.id = startNodeId + endNodeId;
		this.weighted = weighted;
	}

	public String getAnotherNodeId(String nodeId) {
		if (!nodeId.equals(endNodeId)) {
			return endNodeId;
		} else {
			return startNodeId;
		}
	}
}
